package itdep.services.address;

import ga.domain.repository.EntityCriteria;
import ga.domain.repository.GenericEntityFilterProcessor;
import itdep.domain.address.City;

/**
 * @author Ivan Khalopik
 * @version $Revision: 42 $ $Date: 2010-06-25 09:12:54 +0000 (Fri, 25 Jun 2010) $
 */
public class CityFilterProcessor extends GenericEntityFilterProcessor<City, CityFilter> {

	public CityFilterProcessor() {
		super(City.class);
	}

	@Override
	protected void processFilter(EntityCriteria criteria, CityFilter filter) {
		if (filter.getSettlement() != null) {
			criteria.add(criteria.getProperty(City.SETTLEMENT_PROPERTY).eq(filter.getSettlement()));
		}
	}
}
